package com.alibaba.nacos.config;

import org.springframework.cloud.gateway.filter.ratelimit.KeyResolver;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import reactor.core.publisher.Mono;

/**
 * @program: nacos-spring-cloud-example
 * @description: 限流规则配置类
 * @author: coderChen
 * @create: 2024-09-29 10:22
 **/
@Configuration
public class KeyResolverConfiguration {
    @Bean
    public KeyResolver pathKeyResolver()
    {
        return exchange -> Mono.just(exchange.getRequest().getURI().getPath());
    }
}
